<template>
  <div class="box7">
    <div class="title">
      <p>年度游客量对比</p>
      <img src="../../images/dataScreen-title.png" alt="" srcset="" />
    </div>
    <div class="charts" ref="charts"></div>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import * as echarts from 'echarts'
let charts = ref()
onMounted(() => {
  //一个容器可以同时展示多种类型的图形图标
  let mychart = echarts.init(charts.value)
  //设置配置项
  mychart.setOption({
    title: {
      text: '散点图',
      left: '50%',
      textStyle: {
        color: 'white',
      },
    },
    xAxis: { type: 'category', show: true },
    yAxis: { show: false },
    grid: {
      left: 20,
      top: 20,
      right: 0,
      bottom: 20,
    },
    series: {
      type: 'scatter',
      data: [
        1,
        31,
        88,
        21,
        9,
        41,
        788,
        234,
        567,
        123,
        678,
        35,
        53,
        823,
        803,
        203,
        204,
        ,
        567,
        23,
        4,
      ],
      label: {
        show: true,
        position: 'top',
        color: 'skyblue',
      },
    },
  })
})
</script>

<style lang="scss" scoped>
.box7 {
  width: 100%;
  height: 100%;
  background: url(../../images/dataScreen-main-cb.png) no-repeat;
  background-size: 100% 100%;
  margin: 20px 0px;

  .title {
    margin-right: 20px;
    margin-top: 10px;

    p {
      color: white;
      font-size: 16px;
    }
  }

  .charts {
    height: calc(100% - 30px);
  }
}
</style>
